package Opgave10_5;

public class Fight<T> {
	
	T one;
	T two;
	T winner;
	
	Fight(T one, T two, T winner) {
		this.one = one;
		this.two = two;
		this.winner = winner;
	}

	public Object getWinner(){
		if (winner instanceof String) {
			return (String)winner;
		} else if (winner instanceof Player) {
			return (Player)winner;
		} else {
			return winner;
		}
	}

	public String toString(){
		return "Fight between " + one + " and " + two + ". " + winner + " wins";
	}

}
